#ifndef _CTORRENTMANAGER_H_
#define _CTORRENTMANAGER_H_

#include "ctorrent.h"

#include <buola/app/ctimer.h>

namespace buola { namespace bitdaemon {

class CTorrentManager : public UUncopiable
{
public:
    CTorrentManager();
    virtual ~CTorrentManager();

    void InitSession();

    void AddTorrent(const io::CURI &pURI,const io::CURI &pDestination);

    const std::vector<CTorrent*> &GetTorrents() {   return mTorrents;   }

    void OnAlertTimer();

private:
    std::unique_ptr<libtorrent::session> mSession;
    std::vector<CTorrent*> mTorrents;

    std::unique_ptr<CTimer> mAlertTimer;
};

/*namespace bitdaemon*/ } /*namespace buola*/ }

#endif
